package com.test.springCloud.utils;

import java.io.File;

import lombok.extern.slf4j.Slf4j;

/**
 * 创建日期工具类
 */
@Slf4j
public class CreateFolder {

	/**
	 * 根据今日创建文件夹
	 * 
	 * @param prefixFolder
	 */
	public String CreateFolderBasedOnTheToday(String prefixFolder) {
		DataUtil dataUtil = DataUtil.getSingleton();
		String today = dataUtil.currTodayDateNorm2();
		File dest = new File(prefixFolder + "\\" + today);
		if (!dest.exists()) {
			log.info("文件夹不存在,已新建");
			dest.mkdirs();
			return dest.getPath();
		} else
			return dest.getPath();

	}
}
